using KrasDD.Models;
using KrasDD.Services.Interfaces;
using Microsoft.AspNetCore.Mvc;

namespace KrasDD.Controllers
{
    [ApiController]
    [Route("api/[controller]")]
    public class PermissionController : BaseController<PERMISSION>
    {
        private readonly IPermissionService _permissionService;

        public PermissionController(IBaseService<PERMISSION> service, IPermissionService permissionService) : base(service)
        {
            _permissionService = permissionService;
        }

        [HttpGet("{id}/accesses")]
        public async Task<List<ACCESS>> GetAccesses(string id)
        {
            return await _permissionService.GetAccessesAsync(id);
        }
    }
}
